
   : extractr ( DER-sig -- <r in sig> )
OP_3 OP_SPLIT OP_NIP OP_1 OP_SPLIT ( sig -- sig[3:4] sig[4:] ) 
OP_SWAP OP_SPLIT OP_DROP ( sig[4:<sig[3]>] ) ;

   : verifyr ( sigr -- ()/fail )
extractr ( r ) OP_HASH160 ${hashr} OP_EQUALVERIFY ;

   ( sig' pk sigr -- result )
OP_DUP ( sig' pk sigr sigr ) verifyr 
( sig' pk sigr )
OP_OVER ( sig' pk sigr pk )
OP_CHECKSIGVERIFY OP_CHECKSIG